import { type $planet_DataBlocker_poof$, $planet_DataManager_poof$ } from "../../../frame/ALIB/lib.data";

class $planet_User_poof$ {
	$planet_score_poof$: number;
	$planet_elsb_poof$: number;
	$planet_count_elsb_poof$: number;
	$planet_symbol_poof$: number;
	$planet_level_poof$: number;

	$planet_fusionCount_poof$: number;
	$planet_rp_count_poof$: number;
	$planet_score_target_poof$: number;
	$planet_target_planet_poof$: number;

	/** 有效天数 */
	$planet_symbol_day_poof$: number;
	$planet_elsb_day_poof$: number;
	/** 当日2048统计 */
	$planet_dayElsb_poof$: number;

	readonly $planet_score_progress_poof$: number;
}

const blocker: $planet_DataBlocker_poof$<$planet_User_poof$> = {
	$planet_get_poof$: {
		$planet_score_poof$(proxy, value) {
			return value ?? 150;
		},
		$planet_count_elsb_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_symbol_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_score_target_poof$(proxy, value) {
			return value ?? 400;
		},
		$planet_score_progress_poof$(proxy, value) {
			return Math.min(proxy.$planet_score_poof$ / proxy.$planet_score_target_poof$, 1);
		},
		$planet_elsb_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_target_planet_poof$(proxy, value) {
			return value ?? 6;
		},
		$planet_fusionCount_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_rp_count_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_elsb_day_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_symbol_day_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_level_poof$(proxy, value) {
			return value ?? 0;
		},
		$planet_dayElsb_poof$(proxy, value) {
			return value ?? 0;
		},
	},
	$planet_set_poof$: {
		ignore: ['$planet_score_progress_poof$'],
	}
}

export default function $planet_get_proxy_user_poof$(name?: string, prefix?: string){
	return $planet_DataManager_poof$.$planet_initProxy_poof$(name??'$planet_user_poof$', new $planet_User_poof$(), true, blocker, prefix??'');
}